import {
    apiBase
} from './common';
export function getInitLabels() {
    return new Promise((resolve, reject) => {
        wx.request({
            url: `${apiBase}label/init`,
            header: {
                'content-type': 'application/x-www-form-urlencoded; charset=utf-8'
            },
            dataType: 'json',
            method: 'GET',
            success: (data, statusCode, header) => {
                resolve(data.data);
            },
            fail: () => {
                console.log(arguments);
                reject(arguments);
            }
        });
    });
}
export function skipInitLabelSelect(faiSessionKey) {
    return new Promise((resolve, reject) => {
        wx.request({
            url: `${apiBase}label/skipInitSelect`,
            header: {
                'content-type': 'application/x-www-form-urlencoded; charset=utf-8'
            },
            dataType: 'json',
            method: 'POST',
            data: {
                faiSessionKey: faiSessionKey
            },
            success: (data, statusCode, header) => {
                resolve(data.data);
            },
            fail: () => {
                console.log(arguments);
                reject(arguments);
            }
        });
    });
}
export function initLabelSelect(faiSessionKey, ids) {
    return new Promise((resolve, reject) => {
        wx.request({
            url: `${apiBase}label/initSelect`,
            header: {
                // 'content-type': 'application/json; charset=utf-8',
                'content-type': 'application/x-www-form-urlencoded; charset=utf-8'
            },
            dataType: 'json',
            method: 'POST',
            data: {
                faiSessionKey: faiSessionKey,
                labelIds: ids
            },
            success: (data, statusCode, header) => {
                resolve(data.data);
            },
            fail: () => {
                console.log(arguments);
                reject(arguments);
            }
        });
    });
}